home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / tex / meta27 / mfpandor.lzh / panpunct.mf < prev    next >
Text File  |  1990-11-16  |  17KB  |  479 lines

  1. %*****************************************************************************
  2. %        Copyright (c) 1989 by N. N. Billawala
  3. %*****************************************************************************
  4.  
  5.  
  6. % punct.mf  punctuation: common in all character sets
  7.  
  8. % 21 characters
  9.  
  10.  
  11. iff OK "!":  "Exclamation point";
  12.   beginchar("!",I_w*width#+a_mono#,cap#,0);
  13.   min_limit(join_radius)(.5thin_stem.uc);
  14.   bot z1=(round(.5w),0);
  15.   z0=bot z1+(0,.5accent_dot_diameter);
  16.   top z3=(x1,h)//;  pos3(stem.uc,-oblique);
  17.   onaline(0,3)(2);  bot y2=max(bot y1+accent_dot_diameter+2,.3y3);
  18.   pos2(thin_stem.uc,-oblique);
  19.  
  20.   p1=dot.b(z1,accent_dot_diameter);
  21.   p2=(z3--z3l)softjoin(z3l--z2l)softjoin(z2l--z2r)softjoin(z2r--z3r)
  22.       softjoin(z3r--z3)--cycle;
  23.  
  24.   showpoints(0,1,2,3);
  25. adjust(v_a*fitbasis.uc#+m_a*a_mfit#,v_a*fitbasis.uc#+m_a*a_mfit#); 
  26. show_character; endchar;
  27.  
  28. % rotation of shape and slant of position with obliqueness
  29.  
  30.  
  31. iff OK "#":  "Sharp/number/hash/pound"; 
  32.   beginchar("#",.5width#+b_mono#,ascender#,descender#);
  33.   min_limit(join_radius)(.375stem.uc);
  34.  
  35.   multpos(1,2,3,4)(max(1,.75stem.uc),90);
  36.   bot lft z3l=(0,round(1.05math_axis-.2h-.5*max(1,.75stem.uc)))//;
  37.   z4l=(x3l+.9w,y3l);
  38.   bot rt z2l=(w,y3l+round .4h)//;  
  39.   z1l=(x2l-.9w,y2l);
  40.   onaline(1,2)(11); x11=round(.27[x1,x2]); 
  41.   onaline(3,4)(12); x12=round(.27[x3,x4]); 
  42.   onaline(11,12)(5,6); top y5=h-mathlines; bot y6=-d+mathlines;
  43.  
  44.   pickup mathpen rotated (angle(z5-z6)-90);
  45.   draw z5--z6; 
  46.   draw (z5--z6) shifted 
  47.        (max(round .5mathlines+2,round(abs(x2-x1))-2*round(.27(x2-x1))),0);
  48.   p1=(z1 soften(z1l,z2l,z2r,z1r) z1)--cycle;  
  49.   p2=(z3 soften(z3l,z4l,z4r,z3r) z3)--cycle;  
  50.  
  51.   showpoints(1,2,3,4,5,6,11,12);
  52. adjust(v_G*fitbasis.uc#+m_a*b_mfit#,v_G*fitbasis.uc#+m_a*b_mfit#); 
  53. show_character; endchar;
  54.  
  55.  
  56. iff OK "$":  "Dollar sign"; 
  57.   beginchar("$",num_width_b#+b_mono#,ascender#,0);
  58.  
  59.   top y2l=bot y2r+max(1,.75minor_curve.uc)=round(.9(h+d));
  60.   bot y6r=top y6l-max(1,.75minor_curve.uc)=round(.12(h+d));
  61.   rt z1=(.93w,y2r-.05(y2r-y6r))//;                 
  62.   lft z7=(0,y6r+.1(y2r-y6r))//;     
  63.   z4=(.5w,.52[y6r,y2l])//;
  64.   lft z3l=(if narrow_condition:0 else:round(.05w) fi,.5[y4,y2l])//; 
  65.   rt z5r=(w,.5[y6r,y4])//; 
  66.   good_x_for(2l)(z3l,z1,.5)a;  good_x_for(2r)(z3r,z1-(bulb_thickness,0),.4)b;
  67.   good_x_for(6r)(z7,z5r,.5)c;  good_x_for(6l)(z7+(bulb_thickness,0),z5l,.6)d;
  68.  
  69.   z3=z3l+(.5stem.uc,0); z5=z5r-(.5stem.uc,0);
  70.   ref1=z3..z4..z5;
  71.   pos4(stem.uc,(angle (postcontrol 1 of ref1-precontrol 1 of ref1))+90);
  72.   rt z3r=(lft x3l+max(1,.75stem.uc),(1-v_stress)[y4r,y2r]); 
  73.   lft z5l=(rt x5r-.75stem.uc,v_stress[y6l,y4l]);
  74.  
  75.   bot z10=(.5w,-ov_b.uc);  multpos(10,11)(max(1,.75thin_stem.uc),-oblique);
  76.   top z11=(.5w,h+ov_t.uc)//;
  77.  
  78.   p1=bulb.tr(z1,z2r,z2l,cs,bulb_thickness,90) 
  79.      o_t z3l{downward} o_t z4l i_t z5l i_t 
  80.      bulb.bl(z7,z6l,z6r,cs,bulb_thickness,90)
  81.      o_t z5r{upward} o_t z4r i_t z3r i_t cycle;
  82.   p2=(.5[z10l,z11l] soften(z11l,z11r,z10r,z10l) .5[z10l,z11l])--cycle;
  83.  
  84.   showpoints(1,2,3,4,5,6,7,8,10,11);
  85. adjust(.5num_fit_b#+m_a*b_mfit#,.5num_fit_b#+m_a*b_mfit#); 
  86. show_character; endchar;
  87.  
  88. % currently same width as the lining numbers
  89.  
  90.  
  91.  
  92. iff OK "%":  "Percent sign"; 
  93.   beginchar("%",.5width#+d_mono#,ascender#,0);
  94.  
  95.   top y1r=h;   bot y1l=top y1r-max(1,.5major_curve.lc);
  96.   bot y3r=.6h; top y3l=bot y3r+max(1,.5major_curve.lc);  
  97.   lft z2r=(0,(1-v_stress)[y3r,y1r])//;
  98.   rt z2l=(lft x2r+max(1,.5bowlstem.lc),(1-v_stress)[y3r,y1r]);  
  99.   rt z4r=(round(.5w),v_stress[y3r,y1r])//;
  100.   lft z4l=(rt x4r-max(1,.5bowlstem.lc),v_stress[y3r,y1r]);  
  101.   good_x_for(1r)(z2r,z4r,.52)a;  good_x_for(1l)(z2l,z4l,.48)b;  
  102.   good_x_for(3r)(z2r,z4r,.48)c;  good_x_for(3l)(z2l,z4l,.52)d;  
  103.  
  104.   pickup mathpen rotated angle((w,h)//-(0,0)//);
  105.   z10=(round(.5w),round(-.6h))//;
  106.   top rt z11=(w,h)//;          
  107.   bot lft z12=(0,0)//;
  108.   draw z11--z12;
  109.  
  110.   p1 =z1r{left} o_t z2r{downward} o_t z3r{right} o_t z4r{upward} o_t cycle;
  111.   p1'=z1l{left} i_t z2l{downward} i_t z3l{right} i_t z4l{upward} i_t cycle;
  112.   p2 =p1 shifted z10;
  113.   p2'=p1' shifted z10;
  114.  
  115.   z13r= point 3.5 of p1; pos13(max(1,.5major_curve.lc),90-oblique);
  116.   z14r= (.5[x13,x11],y13); pos14(max(1,.35bowlstem.lc),90-oblique);
  117.   z15=z11+(.5mathlines,0)rotated (angle((w,h)//-(0,-d)//)+90);
  118.   p3=z13l...z14l{right}...z15--z15...z14r{left}...z13r--cycle;
  119.  
  120.   showpoints(1,2,3,4,11,12,13,14,15);
  121. adjust(v_C*fitbasis.uc#+m_a*d_mfit#,v_C*fitbasis.uc#+m_a*d_mfit#); 
  122. show_character; endchar;
  123.  
  124.  
  125. iff OK "&":  "Ampersand"; 
  126.   beginchar("&",.65width#+d_mono#,cap#,0);
  127.  
  128.   bot y6r=top y6l-thin_stem.uc=-ov_b.uc;
  129.   top y2l=y2r+max(1,.9thin_stem.uc)=h+ov_t.uc;
  130.   z4=.65[z6r,z2l];  
  131.   rt z1l=(.75w if narrow_condition:+.05w fi,.5[y4,y2r])//;
  132.   pos1(max(1,.9thin_stem.uc),180); 
  133.   lft z3l=(round(.25w),.5[y4,y2r])//; 
  134.   pos3(max(1,.9stem.uc),0); 
  135.   z5=(if narrow_condition:.93w else:.9w fi,.8[y6r,y4])//; 
  136.   z11=(.95[x6l,x5],y5-terminal_thickness-.07h); 
  137.   multpos(5,11)(max(1,if narrow_condition:.8 else:.9 fi *thin_stem.uc),0);
  138.   lft z7r=(0,.45[y6r,y4])//;    rt z7l=z7r+(bowlstem.uc,0);      z7=.5[z7l,z7r];
  139.   z8=.5[z7r,z1l];
  140.   good_x_for(2r)(z3r,z1r,.5)a;  good_x_for(2l)(z3l,z1l,.5)b;
  141.   good_x_for(6l)(z7l,z11l,.4)c;  good_x_for(6r)(z7r,z11r,.4)d;
  142.   x6l:=min(x6l,x6r+thin_stem.uc);
  143.  
  144.   z9l=z8;
  145.   bot rt z10=(.9w,0); pos10(max(1,.57stem.uc),10);
  146.   ref0=z1{downward}..z8..z7{downward}; 
  147.   pos8(max(1,thin_stem.uc),angle(direction 1 of ref0)+90);
  148.   pos9(max(1,.9stem.uc),angle(direction 1 of ref0)+180);
  149.  
  150.   ref1=z2r{left} i_t z3r{downward}...
  151.        subpath(0,4)of reverse terminalserif.r(z10,z9,z9l,z9r,.5ts,0)soft;
  152.   ref2=subpath(4,20)of reverse terminalserif.r(z10,z9,z9l,z9r,.5ts,0)soft
  153.        ...z3l{upward} o_t z2l{right};
  154.   ref3=z6r{left} o_t z7r{upward} o_t z8l i_t z1r{upward} i_t z2r{left}; 
  155.   ref4=z6l{left} i_t z7l{upward} i_t z8r o_t z1l{upward} o_t z2l{left};
  156.   ref5=z5l..z11l i_t z6l{left};
  157.   ref6=reverse terminalserif(z5,z11,z11l,z11r,.75hs,0) o_t z6r{left}; 
  158.  
  159.   (t1,t2)=ref1 intersectiontimes ref3;  (t3,t4)=ref2 intersectiontimes ref3;
  160.   (t5,t6)=ref1 intersectiontimes ref4;  (t7,t8)=ref2 intersectiontimes ref4;
  161.   (t9,t10)=ref1 intersectiontimes ref5; (t11,t12)=ref2 intersectiontimes ref5;
  162.   (t13,t14)=ref1 intersectiontimes ref6;(t15,t16)=ref2 intersectiontimes ref6;
  163.  
  164.   p1 =reverse(subpath(0,t14)of ref6--subpath(t13,infinity)of ref1--
  165.       subpath(0,t15)of ref2--subpath(t16,infinity)of ref6--
  166.       subpath(0,t4)of ref3--subpath(t3,infinity)of ref2--
  167.       subpath(infinity,t6)of ref4--subpath(t5,t9)of ref1--
  168.       subpath(t10,1)of ref5)--cycle;
  169.   p1'=subpath(0,t1)of ref1--subpath(t2,infinity)of ref3--cycle;  
  170.   p2'=subpath(0,t8)of ref4--subpath(t7,t11)of ref2--
  171.       subpath(t12,infinity)of ref5--cycle;
  172.  
  173.   showpoints(1,2,3,4,5,6,7,8,9,10,11,41,42,43,44,45,46,47,48,100);
  174. adjust(v_C*fitbasis.uc#+m_a*d_mfit#,v_G*fitbasis.uc#+m_a*d_mfit#); 
  175. show_character; endchar;
  176.  
  177.  
  178. iff OK "'":  "Single right quote or apostrophe";
  179.   beginchar(oct"047",I_w*width#+a_mono#,cap#,0);
  180.   save_num(head)=accent_dot_diameter;
  181.   top z1=(.5w,.75[xheight,cap]-.5head)//;
  182.   ref1=comma(z1,head,min(.6xheight,1.5pt),accent_thin_end,0);
  183.   p1=ref1 rotatedaround (z1,if prime:prime_angle fi -oblique);
  184.   showpoints(1);
  185. adjust(v_a*fitbasis.lc#+m_a*a_mfit#,v_a*fitbasis.lc#+m_a*a_mfit#); 
  186. show_character; endchar;
  187.  
  188. % rotation and slant of position with obliqueness
  189.  
  190.  
  191. iff OK "(":  "Left parenthesis";             % need to add shift if w>.45h
  192.   beginchar("(",.25width#+b_mono#,maxheight#,maxdepth#); 
  193.   save_num(width_limit)=min(w,.4(h+d)); 
  194.   parenthesis_curl:=2; def p_c={curl parenthesis_curl} enddef;
  195.   min_limit(join_radius)(max(.5,.37thin_stem.uc));
  196.  
  197.   top z1l=(width_limit,h)//;
  198.   bot z3l=(width_limit,-d)//;
  199.   lft z2l=.5[z1l,z3l]+(width_limit,0)rotated(180-oblique);
  200.   pos2(max(1,.75stem.uc),-oblique);  
  201.   ref1=z1l...z2l{downward}...z3l; 
  202.   pos1(max(1,.75thin_stem.uc),angle(direction 0 of ref1)+90);
  203.   pos3(max(1,.75thin_stem.uc),angle(direction 2 of ref1)+90);
  204.   ref2=z1l p_c..z2l{downward}..p_c z3l; ref3=z3r p_c..z2r{upward}..p_c z1r;
  205.  
  206.   if softpath:p1=(z2l{downward}..p_c z3l)softjoin(z3l--z3r)softjoin
  207.          ref3 softjoin(z1r--z1l)softjoin(z1l p_c..z2l{downward})--cycle;
  208.     else:p1=ref2--ref3--cycle;  fi
  209.  
  210.   showpoints(1,2,3);
  211. adjust(v_C*fitbasis.uc#+m_c*b_mfit